package main

import (
	"encoding/json"
	"fmt"
	"time"
)

func main()  {
	//var uid int32
	//uid = 6189838
	//str := fmt.Sprintf("%d", uid)
	//str2 := ""
	//for k, v := range str {
	//	fmt.Println(k, v)
	//	str2 = str2 + string(v+49)
	//}
	//fmt.Println(str2)

	t1 := time.Now().Unix()
	t2 := time.Now()
	fmt.Println("t2:", t2.Unix())
	t2 = t2.Add(time.Duration(1) * time.Minute)

	fmt.Println("t1:", t1)

	fmt.Println("t2:", t2.Unix())

	num := 1600012399 - 2.5*60*60
	fmt.Println(int32(num ))

	num = 5329230 / 60
	fmt.Println(num)

	arr := []int32{
		4026397,
		3962391,
		3983123,
		3990599,
		6154897,
		5287918,
		4558492,
		4784605,
		4319725,
	}
	for _, v := range arr {
		easeGetUidStr(v)
	}


	bodyData := `{"id":"order_FeLiTR2dIv06zK","entity":"order","amount":2500,"amount_paid":0,"amount_due":2500,"currency":"INR","receipt":"MAL_D_5_A4DE6D094F98B005D24CEAAFE429D999","offer_id":null,"status":"created","attempts":0,"notes":{"customerEmail":"ritaffaella@outlook.com","mobile":"9821169383","payNum":"MAL_D_5_A4DE6D094F98B005D24CEAAFE429D999","userId":"3659778"},"created_at":1600400782} `
	body := map[string]interface{}{}
	err := json.Unmarshal([]byte(bodyData), &body)
	fmt.Println(err, body, body["id"].(string))
}


//把uid转成字母
func easeGetUidStr(uid int32) string {
	str := fmt.Sprintf("%d", uid)
	str2 := ""
	for _, v := range str {
		//fmt.Println(k, v)
		str2 = str2 + string(v+49)
	}
	fmt.Println(uid, str2)
	return str2
}
